1. Field of the Invention
The present invention relates to a positioning method for capturing an image of a product to position the product, a visual inspection apparatus for inspecting appearance of the product, a visual inspection method, a program, and a computer readable recording medium.
2. Description of Related Art
Visual inspection is performed for making a pass/fail determination on a product manufactured in a factory. In the visual inspection, an inspection target is photographed by a camera to acquire an inspection target image. A product is subjected to the visual inspection while being carried by a belt conveyor or the like. However, a position of the product on the belt conveyor is not constant. Hence it is necessary to decide a position where the product appears in the inspection target image. In this positioning, a position of a model pattern in the inspection target image is searched. That is, a partial image similar to the model pattern is specified in the inspection target image, to perform the visual inspection. The model pattern is a pattern to be a standard for a product which is previously acquired from an inspection passed product or the like. The model pattern may be the entire product or a part of the product. In such a search, a template image including the model pattern may be previously prepared, and normalized correlation between the inspection target image and the template image may be used. Further, geometrical search may be performed using edge information extracted from the template image (Unexamined Japanese Patent Publication No. 2010-067246).
Meanwhile, some products manufactured in factories have high symmetry in shape, such as ball bearing, a wheel of an automobile, and a connector of an electronic device. Even when such a product having symmetry is used, by extracting the edge information, the position of the model pattern in the inspection target image can be obtained. However, on the belt conveyor, not only the position of the product is deviated, but a posture of the product may be rotated. Thus, the posture also needs to be corrected. However, it has been difficult to precisely obtain a posture (rotating angle) of the product with high symmetry.
Although even such a product has a portion to be a feature of the posture, an area of the portion is very small as compared with an area of the entire product, and is thus ignored in the search. Further, when a size reduced image is to be used for accelerating search processing, the postural feature may disappear due to the image reduction. When the accuracy in positioning including the posture deteriorates, the accuracy of the visual inspection also deteriorates. For example, it is considered that even a non-defective product is not determined such and discarded. Accordingly, it is an object of the present invention to accurately position a product even when it has symmetry.